Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register h5 #5

Merged
merged 2 commits into from
Feb 23, 2024
Merged

Register h5 #5

merged 2 commits into from
Feb 23, 2024

Conversation

dylanmcreynolds
Copy link
Member

This PR adds a partial adapter to add a spec.

To put it another way, this will get called for every h5 file registered, and by the process_file function, which give it a chance to add the diamond tomography spec that will get used downstream.

Copy link
Member

@Wiebke Wiebke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great.

Just to record my understanding of this: Since user-defined adapters take precedence over the default ones, any file with file-extension registered to mimetype application/x-hdf5 ingested with this script will get the additional spec, but since we are still returning a regular HDF5Adapter, we have no need to implement any of the reading functionality.

@dylanmcreynolds
Copy link
Member Author

any file with file-extension registered to mimetype application/x-hdf5 ingested with this script will get the additional spec

Yes, and this would be very problematic in some cases, but since we control when this is ever called (it's only in our custom rabbit/activeMQ listener at Diamond listening for reconstructions), we can get away with it. If this were a more generic place, we would need to investigate the h5 file in this code to make sure it actually corresponds to our spec.

we are still returning a regular HDF5Adapter, we have no need to implement any of the reading functionality.

Right. Adding these specs allows us to some day build out the full on adapter if we decide we need it... Oh, this is a diamond tomo? Well, when we serve /processed/extra_special_data is a COO coded sparse array.

This PR closes #5

@dylanmcreynolds dylanmcreynolds merged commit 88ae305 into main Feb 23, 2024
2 checks passed
@dylanmcreynolds dylanmcreynolds deleted the register_h5 branch February 23, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants